#include "mainwindow.h"
#include "dialoglogin.h"
#include <QApplication>
#include "cangku.h"
#include "guoshu.h"
#include "value.h"
#include "admin_0.h"
#include "custom.h"
#include "dlcw.h"

int LoginFlag=0;
int count=0;
std::string _name="admin123";
std::string _password="123";
std::string money_reason="无";
char money_type='+';
double money_count=0.00;
char name1[50];
char nickname1[50];
char number1[50];
double count01;
double inprice1;
double outprice1;
char indate1[50];
int count1=0;
int count2=0;
int count3=0;
int count4=0;
int typ1;
struct good *p;
struct good *ss2;
struct good *ss1;
struct good *ss3;
int exp1;
char purchasedate1[50];

int main(int argc, char *argv[])
{
    int nnnn=0;
    //初始化四个链表头
    p=log_start(p,&nnnn);
    if(p==NULL){
        count1=0;
    }
    else count1=nnnn;
    ss1=log_start1(ss1,&nnnn);
    if(ss1==NULL){
        count2=0;
    }
    else count2=nnnn;
    ss2=log_start2(ss2,&nnnn);
    {
        if(ss2==NULL){
            count3=0;
        }
        else count3=nnnn;
    }
    //检索过期产品
    del1();
    ss3=log_start3(ss3,&nnnn);
    if(ss3==NULL){
        count4=0;
    }
    else count4=nnnn;
    //count4=nnnn;
    QApplication a(argc, argv);
    DialogLogin *dlg=new DialogLogin;
    Admin_0 ad;
    Custom cus;
    if(dlg->exec()==QDialog::Accepted){
        if(LoginFlag==1) ad.show();//1为管理员 2为用户
        else if(LoginFlag==2) cus.show();
        return a.exec();
    }
    return 0;
}
